import java.util.*;
import java.io.*;

public class GenTPReg{
    // 
    public static final int numTP = 1000;
    public static final float maxTP = 1.0F;
    public static final float minTP = -0.998F;
    public static float[] testPoints;
    
    public static void main(String[] args){
        // Pulling parameter: length of boolean vector and output file name
        final String oFile = args[0];
        // Define headers
        final String head1 = "Evaluated: F\nFitness: f0000000000|0.0|";
        final String head2 = "i1|f0000000000|";
        final String head2a = "i1|f-1000000000";
        final String head2b = "i1|f1000000000";
        selectObjTP();
        
        // Open Output
        PrintWriter outf;
        try {  // Create the output stream.
            outf = new PrintWriter(new FileWriter(oFile));
        }
        catch (IOException e) {
            System.out.println("Can't open file "+oFile+"!");
            System.out.println("Error: " + e);
            return;        // End the program.
        }
        
        // Output
        for(int i=0; i<numTP;i++){
            outf.println(head1);
            outf.println(head2+Float.toString(testPoints[i])+"|");
            //if(testPoints[i]<0)
            //    outf.print(head2a+"|"+(testPoints[i]).toString()+"|\n");
            //else
            //    outf.print(head2b+"|"+(testPoints[i]).toString()+"|\n");
        }
        outf.close();
        System.out.println("Done!");
    }
    
    public static void selectObjTP()
    {
        testPoints = new float[numTP];
        float inc = (maxTP - minTP) / ((float)(numTP-1));
        //System.out.print("Test points: ");
        for(int i=0; i<numTP; i++){
            testPoints[i] = minTP + ((float)i) * inc;
            //System.out.print(testPoints[i]+" ");
        }
        //System.out.print("\n");
    }
}
